package com.example.broadcast.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.example.broadcast.OrderBroadcastActivity;

public class OrderBroadcastReceiverB extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent!=null&&intent.getAction().equals(OrderBroadcastActivity.ACTION_ORDER))
        {
            Log.d("tang", "onReceive: B接受到了标准广播");
            abortBroadcast();//B收到广播后中断广播，原本A可以在B之后收到广播的，但是中断后就收不到了
        }
    }
}
